package cinvestav.adviseme.controller;

import java.util.List;
import java.util.Map;

import cinvestav.adviseme.databasemodel.ComentarioDB;
import cinvestav.adviseme.databasemodel.IComentarioDB;
import cinvestav.adviseme.datamodel.Comentario;
import cinvestav.adviseme.util.DBException;

public class ComentarioController implements IComentarioController {

	protected IComentarioDB comentarioDB; 
	
	
	public ComentarioController() throws DBException{
		super();
		this.comentarioDB = new ComentarioDB();
	}
		
	
	public ComentarioController(IComentarioDB comentarioDB) {
		super();
		this.comentarioDB = comentarioDB;
	}
		

	public IComentarioDB getComentarioDB() {
		return comentarioDB;
	}


	public void setComentarioDB(IComentarioDB comentarioDB) {
		this.comentarioDB = comentarioDB;
	}


	public List<Comentario> getByFilters(Map<String,String[]> filtros) throws DBException{
		return comentarioDB.getByFilter(filtros);
	}
	
	public void insert(Comentario comentario) throws DBException{
		comentarioDB.insert(comentario);
	}
}
